﻿
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
		String path = request.getContextPath();
		String basePath = request.getScheme() + "://" + request.getServerName()
				+ ":" + request.getServerPort() + path + "/";
%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>main</title>
<LINK href="./css/style.css" type=text/css rel=stylesheet>
<LINK href="./css/main.css" type=text/css rel=stylesheet>
<script src="./js/WebCalendar.js" type="text/javascript"></script>
<script src="./js/main.js" type="text/javascript"></script>
<script src="./js/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="./js/jquery.validate.min.js" type="text/javascript"></script>
<script src="./js/validate.js" type="text/javascript"></script>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #5CB7FE;
}
.STYLE1 {font-size: 12px}
a:link {
	text-decoration: none;
}
a:visited {
	text-decoration: none;
}
a:hover {
	text-decoration: underline;
}
a:active {
	text-decoration: none;
}
.STYLE5 {font-size: 12px; color: #FF0000; }
.STYLE6 {
	font-size: 16px;
	font-weight: bold;
}
-->
 </style>
</head>
<script language="javascript">
function fn_showSelect(reportType, reportYear, reportMonth, reportQuarter, reportHalfYear) {
    if (reportType == 0) {
    	if (reportYear != 0 && reportMonth !=0) {
    		$("#reportType").val(reportType);
    		$("#reportYear").val(reportYear);
    		$("#reportMonth").val(reportMonth);
    	}
        $("#reportMonth").css('display','block'); 
 		$("#reportQuarter").css('display','none');
 		$("#reportHalfYear").css('display','none');
 		$("#rTitle").html("月份：");
    } else if (reportType == 1) {
    	if (reportYear != 0 && reportMonth !=0) {
    		$("#reportType").val(reportType);
    		$("#reportYear").val(reportYear);
    		$("#reportQuarter").val(reportQuarter);
    	}
        $("#reportMonth").css('display','none'); 
 		$("#reportQuarter").css('display','block');
 		$("#reportHalfYear").css('display','none');
 		$("#rTitle").html("季度：");
    } else if (reportType == 2) {
    	if (reportYear != 0 && reportHalfYear !=0) {
    		$("#reportType").val(reportType);
    		$("#reportYear").val(reportYear);
    		$("#reportHalfYear").val(reportHalfYear);
    	}
        $("#reportMonth").css('display','none'); 
 		$("#reportQuarter").css('display','none');
 		$("#reportHalfYear").css('display','block');
 		$("#rTitle").html("半年：");
    } else if (reportType == 3) {
    	if (reportYear != 0) {
    		$("#reportType").val(reportType);
    		$("#reportYear").val(reportYear);
    	}
        $("#reportMonth").css('display','none'); 
 		$("#reportQuarter").css('display','none');
 		$("#reportHalfYear").css('display','none');
 		$("#rTitle").html("");
    }
}

$(document).ready(function() {
	$("#reportType").change(function(){
    	fn_showSelect($("#reportType").val());
	});
	fn_showSelect('<s:property value="subReportType"/>', '<s:property value="reportYear"/>','<s:property value="reportMonth"/>','<s:property value="reportQuarter"/>','<s:property value="reportHalfYear"/>');
});

</script> 

<body style="overflow-x:hidden">
<table width="100%" height="568" border="0" cellpadding="0"
	cellspacing="0" bordercolor="#D8EDFF">
	<!--DWLayoutTable-->
	<tr>
		<td height="8" colspan="4" valign="top"></td>
		<td width="834" valign="top"></td>
		<td width="5" valign="top"></td>
	</tr>
	<tr>
		<td height="5" colspan="3" align="right" valign="top"><img
			src="images/icon1.jpg" width="6" height="5" /></td>
		<td colspan="2" valign="top"><img src="images/icon2.jpg" width="100%"
			height="5" /></td>
		<td valign="top"><img src="images/icon3.jpg" width="5" height="5" /></td>
	</tr>
	<tr>
		<td width="7" height="523">&nbsp;</td>
		<td width="5" align="right" valign="top" background="images/icon5.jpg"><img
			src="images/icon5.jpg" width="5" height="5" /></td>
		<td colspan="2" valign="top" bgcolor="#D8EDFF">&nbsp;</td>
		<td valign="top" background="images/main_bg.png">
		
		<table width="100%" border="0" cellpadding="0" cellspacing="0"
			bgcolor="#D8EDFF">
			<!--DWLayoutTable-->
			<tr>
				<td height="30" colspan="3" valign="middle"><span class="STYLE1"><a href="reportMgmt.action">[报表管理]</a> &rarr; [月，季度，半年，年度报表]</span></td>
				<td width="29">&nbsp;</td>
			</tr>
			<tr>
				<td height="59" colspan="3" align="center" valign="middle" class="STYLE6">月，季度，半年，年度报表</td>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<td colspan="4" align="center" valign="middle">
				<s:if test="msg != '' && msg != null"> 
  				 	<div id="msg">
  				 		<table>
  				 			<tr>
  				 				<td width="1%"><img src="images/error.gif"></td>
  				 				<td>&nbsp;&nbsp;<span id="msgText"><s:property value="msg"/></span></td>
  				 				<td width="1%"><img src="images/close.png" alt="关闭" style="cursor:pointer;" onclick="closeMsgBox()"/></td>
  				 			</tr>
  				 		</table>
  				 	</div>
				</s:if>
				</td>	
			</tr>
			<tr>
				<td width="90" height="345">&nbsp;</td>
				<td width="90%" valign="top">
		<form name="searchform" id="searchform" method="post" action="report!periodReport.action" onsubmit="return fn_checkSmt();">
			 <fieldset>
   				 <legend class="STYLE1"><img alt="查询" src="images/search.png"/> &nbsp;&nbsp;生成报表</legend>
					<table>
						<tr>
						  <td width="8" align="right" valign="middle"></td>
						  <td align="right" valign="middle"><span class="STYLE1">图号：</span></td>
						  <td valign="middle"><input name="drawingNum" id="drawingNum" type="text" size="16" maxlength="20" style="width:80px; height:18px;" value="<s:property value="drawingNum"/>"/></td>
						  <td width="8"></td>
						  <td align="right" valign="middle"><span class="STYLE1">厂家名称：</span></td>
						  <td valign="middle"><input name="vendor" id="vendor" type="text" size="16" maxlength="20" style="width:80px; height:18px;" value="<s:property value="vendor"/>"/></td>
						  <td width="8"></td>
						  <td align="right" valign="middle"><span class="STYLE1">报表类型：</span></td>
						  <td valign="middle"><select name="subReportType" id="reportType">
						  						<option value="0">月报</option>
						  						<option value="1">季报</option>
						  						<option value="2">半年报</option>
						  						<option value="3">年报</option>
						  					</select></td>
						  <td width="8"></td>
						  <td align="right" valign="middle"><span class="STYLE1">年份：</span></td>
						  <td valign="middle">
						  <select name="reportYear" id="reportYear">
		  						<option value="2013">2013</option>
		  						<option value="2014">2014</option>
		  						<option value="2015">2015</option>
		  						<option value="2016">2016</option>
		  						<option value="2017">2017</option>
		  						<option value="2018">2018</option>
		  						<option value="2019">2019</option>
		  						<option value="2020">2020</option>
		  						<option value="2021">2021</option>
		  						<option value="2022">2022</option>
		  					</select>
						  </td>
						  <td width="8"></td>
						  <td align="right" valign="middle"><span class="STYLE1" id="rTitle">月份：</span></td>
						  <td valign="middle">
						  <select name="reportMonth" id="reportMonth">
		  						<option value="1">01</option>
		  						<option value="2">02</option>
		  						<option value="3">03</option>
		  						<option value="4">04</option>
		  						<option value="5">05</option>
		  						<option value="6">06</option>
		  						<option value="7">07</option>
		  						<option value="8">08</option>
		  						<option value="9">09</option>
		  						<option value="10">10</option>
		  						<option value="11">11</option>
		  						<option value="12">12</option>
		  					</select>
		  					<select name="reportQuarter" id="reportQuarter" style="display:none">
		  						<option value="1">第一季度</option>
		  						<option value="2">第二季度</option>
		  						<option value="3">第三季度</option>
		  						<option value="4">第四季度</option>
		  					</select>
		  					<select name="reportHalfYear" id="reportHalfYear" style="display:none">
		  						<option value="1">上半年</option>
		  						<option value="2">下半年</option>
		  					</select>
						  </td>
						  <td align="center" valign="middle"><input name="search" type="hidden" value="true"/><input name="submit" type="submit" class="btn1_mouseout" onMouseOver="this.className='btn1_mouseover'" onMouseOut="this.className='btn1_mouseout'" value="查 询 "><input name="search" type="hidden" value="true"/></td>
					  	</tr>
				  </table>
		  	 </fieldset>
		  </form>
				<FORM name="form1" method="post">
				<table width="100%" border=0 cellpadding=0 cellspacing=1
					bgcolor=5cb7fe>
					<!--DWLayoutTable-->
					<tr>
					    <td width="5%" rowspan="2" align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1">序号 </span></td>
						<td width="10%" rowspan="2"  align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1">图号 </span></td>
						<td width="15%" rowspan="2"  align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1">厂家名称 </span></td>
						<td width="8%" align="center" rowspan="2" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1">上季库存</span></td>
				   		<td width="6%" align="center" rowspan="2" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1">本季进厂</span></td>
				        <td width="6%" align="center" rowspan="2" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1">本季出厂</span></td>
						<td width="6%" rowspan="2"  align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1">单位面积 <br/>(m&sup2)</span></td>
						<td width="6%" align="center" rowspan="2" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1">出厂面积<br/>(m&sup2)</span></td>
						<td width="6%" align="center" rowspan="2" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1">出厂金额<br/></span></td>
						<td width="6%" colspan="6"  height="25px" align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1">在厂数量 </span></td>
					</tr>
					<tr>
						<td width="5%" height="25px" align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1">半成品 </span></td>
						<td width="5%" align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1">成品</span></td>
						<td width="5%" align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1">在线</span></td>
				        <td width="5%" align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1">返修</span></td>
						<td width="5%" align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1">报废</span></td>
						<td width="5%" align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1">小计</span></td>
					</tr>
					<s:iterator value="reports" status="st">
					<tr>
					  <td height="25" align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1"><s:property value="#st.count + (currentPage - 1) * pageSize"/></span></td>
					  <td height="25" align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1"><s:property value="drawingNum"/></span></td>
					  <td align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1"><s:property value="vendor"/></span></td>
				  	  <td align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1"><s:property value="lastRepoCount"/></span></td>
					  <td align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1"><s:property value="currentInCount"/></span></td>
					  <td align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1"><s:property value="currentOutCount"/></span></td>
					  <td align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1"><s:property value="unitArea"/></span></td>
					  <td align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1"><s:property value="totalOutArea"/></span></td>
					  <td align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1"><s:property value="totalOutMoney"/></span></td>
					  <td align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1"><s:property value="materialCount"/></span></td>
					  <td align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1"><s:property value="productCount"/></span></td>
					  <td align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1"><s:property value="onlineCount"/></span></td>
					  <td align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1"><s:property value="repaireOnlineCount"/></span></td>
					  <td align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1"><s:property value="discardCount"/></span></td>
					  <td align="center" valign="middle"
							bgcolor="#D8EDFF"><span class="STYLE1"><s:property value="sumInFactoryCount"/></span></td>
				  </tr>
				  </s:iterator>
				  <tr>
				  	<td height="25" colspan="15" align="center" valign="middle" bgcolor="#D8EDFF"><span class="STYLE1"><s:property value="pageBar" escape="false"/></span></td>
				  </tr>
				</table>
				</FORM>
				</td>
				<td width="50">&nbsp;</td>
				<td>&nbsp;</td>
			</tr>
</table>
		</td>
		<td valign="top" background="images/icon6.jpg"><img
			src="images/icon6.jpg" width="5" height="100" /></td>
	</tr>

	<tr>
		<td height="5"></td>
		<td valign="top"><img src="images/icon7.jpg" width="5" height="5" /></td>
		<td colspan="3" valign="top"><img src="images/icon8.jpg" width="100%"
			height="5" /></td>
		<td valign="top"><img src="images/icon9.jpg" width="5" height="5" /></td>
	</tr>
	<tr>
		<td height="2"></td>
		<td></td>
		<td width="1"></td>
		<td width="6"></td>
		<td></td>
		<td></td>
	</tr>
</table>
</body>
</html>
